{$CLEO .cs}

0000:
//19@ = File.Open("cleo\keys_info.dat", "a+")

const
     Cmp_id  = 4@
     slot_id = 5@
end
while true
wait 0
if 0ab0: 77
jf continue
if actor.driving($player_actor)
then 
for slot_id = 0 to 15 step 1
    10@ = actor.CurrentCar($player_actor)
    096D: get_car 10@ component_on_slot slot_id model_to Cmp_id
    06E6: get_itemID Cmp_id destinated_component_slot_to 30@
    gosub @get_index_case1
    078C: get_shopping_item_with_textureCRC Cmp_id nametag_to 17@s
    0ADE: 12@ = text_by_GXT_entry 17@s

    if 19@ = File.Open("cleo\keys_info.dat", "at")
    then 
        File.Seek(19@, slot_id, SEEK_CUR)
        hex
        D9 0A 03 13 00 0E 3D 5B 73 6C 6F 74 5F 69 64 20
        3D 20 25 64 5D 20 5B 53 6C 6F 74 5F 6E 61 6D 65 
        20 3D 20 25 73 5D 20 5B 63 6D 70 5F 4E 61 6D 65 
        20 3D 20 25 73 5D 20 5B 63 6D 70 5F 69 64 20 3D 
        20 25 64 5D 03 05 00 11 1A 00 03 0C 00 03 04 0D 
        0A 00
        end
        0AD9: write_formatted_text "[slot_id = %d] [Slot_name = %s] [cmp_Name = %s] [cmp_id = %d]" 19@ slot_id 26@v 12@ Cmp_id
        File.Close(19@)
    end
end
end
end
                

:get_index_case1
if 30@ == 0 //Hood
then 26@v = "Hood"
    goto @cindex_case_end
end
if 30@ == 1 //Vent
then 26@v = "Vent"
    goto @cindex_case_end
end
if 30@ == 2 //Spoiler
then 26@v = "Spoiler"
    goto @cindex_case_end
end
if 30@ == 3 //Side_Skirt
then 26@v = "Side_Skirt"
    goto @cindex_case_end
end
if 30@ == 4 //Front_Bull_Bar
then 26@v = "Front_Bull_Bar"
    goto @cindex_case_end
end
if 30@ == 5 //Rear_Bull_Bar
then 26@v = "Rear_Bull_Bar"
    goto @cindex_case_end
end
if 30@ == 6 //Lights
then 26@v = "Lights"
    goto @cindex_case_end
end
if 30@ == 7 //Roof
then 26@v = "Roof"
    goto @cindex_case_end
end
if 30@ == 8 //Nitro
then 26@v = "Nitro"
    goto @cindex_case_end
end
if 30@ == 9 //Hydraulics
then 26@v = "Hydraulics"
    goto @cindex_case_end
end
if 30@ == 10 //Stereo
then 26@v = "Stereo"
    goto @cindex_case_end
end
if 30@ == 11 //null
then 26@v = "___"
    goto @cindex_case_end
end
if 30@ == 12 //Wheels
then 26@v = "Wheels"
    goto @cindex_case_end
end
if 30@ == 13 //Exhaust
then 26@v = "Exhaust"
    goto @cindex_case_end
end
if 30@ == 14 //Front_Bumper
then 26@v = "Front_Bumper"
    goto @cindex_case_end
end
if 30@ == 15 //Rear_Bumper
then 26@v = "Rear_Bumper"
    goto @cindex_case_end
end
if 30@ == 16 //Miscellaneous
then 26@v = "Miscellaneous"
    goto @cindex_case_end
end
if 30@ == 17
then 26@v = "___"
    goto @cindex_case_end
end
goto @cindex_case_end

:cindex_case_end
return